<?php

declare(strict_types=1);

use Phinx\Migration\AbstractMigration;


final class UserMigration extends AbstractMigration
{
    
    public function up(): void {
        
        $table = $this->table('user',[
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_general_ci'
        ]);

        $table->addColumn('nickname', 'string', ['limit' => 64,'collation' => 'utf8mb4_general_ci','null' => true])
            ->addColumn('headimg', 'string', ['limit' => 256,'collation' => 'utf8mb4_general_ci','null' => true])
            ->addColumn('open_id', 'string', ['limit' => 64,'collation' => 'utf8mb4_general_ci'])
            ->addColumn('access_token', 'string', ['limit' => 64,'collation' => 'utf8mb4_general_ci','null' => true])
            ->addColumn('created_at', 'integer', ['limit'=>11])
            ->addColumn('updated_at', 'integer', ['limit'=>11])
            ->save();
    }
}
